<template>
	<view class="box">
		<uNavbar title="领取记录" bgColor="#292929"></uNavbar>
		<view class="main">
			<view class="main_item" v-for="item in fullist" :key="item.id">
				<view class="main_item_bottom">
					<view class="main_item_text">
						{{item.from_desc}}：{{item.amount}}
					</view>
					<view class="main_item_time">
						{{item.create_time}}
					</view>
				</view>
		<!-- 		<view class="main_item_top">
					<view class="main_item_from">
						备注：售卖藏品直推奖-554
					</view>
					
				</view> -->

			</view>
		</view>
		<noDatas :xxxList="fullist" :status="status"></noDatas>
	</view>

</template>

<script>
	import {balanceList} from "../../api/other.js"
	export default {
		data() {
			return {
			fullist:[],
			page: 1,
			size: 30,
			status: 'loadmore', //加载前值为loadmore，加载中为loading，没有数据为nomore
			}
		},
		onLoad() {
			this.getlist()
		},
		methods: {
			getlist(){
				balanceList({
					page:this.page,
					type:1
				}).then(res=>{
					if (res.code == 1) {
						let list = res.data.data;
						this.fullist = this.page == 1 ? list : this.fullist.concat(list);
						console.log(this.fullist);
						if (list.length < this.size) this.status = 'nomore';
						else this.status = 'loading';
					}
				})
			}
		},
		onReachBottom() {
			if (this.status != 'nomore') {
				this.page = this.page + 1
				this.getlist()
			}
		},
	}
</script>
<style>
	page{
		background-color: #292929;
	}
</style>
<style lang="scss" scoped>
	/deep/ .uicon-arrow-left{
		color: #fff !important;
	}
	/deep/.u-navbar__content__title{
		color: #fff !important;
	}
	.box {
		width: 750rpx;
		height: 100vh;
		background-color: #292929;
	}

	.main {
		width: 750rpx;
		margin-top: 40rpx;
		.main_item {
			width: 690rpx;
			// height: 150rpx;
			// background: #F2F2F2;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin: 0 auto;
			margin-bottom: 30rpx;
			.main_item_top {
				display: flex;
				justify-content: space-between;

				.main_item_from {
					font-size: 28rpx;
					color: rgba(255,255,255,0.6);
					margin: 24rpx;
				}

				.main_item_price {
					font-weight: 500;
					font-size: 36rpx;
					color: #A68A64;
					margin: 24rpx;
				}
			}
			.main_item_bottom{
				display: flex;
				justify-content: space-between;
				align-items: center;
				
				.main_item_text{
					font-size: 28rpx;
					color: #fff;
					margin-left: 24rpx;
				}
				.main_item_time{
					font-weight: 400;
					font-size: 24rpx;
					color: #fff;
					margin-right: 24rpx;
				}
			}
		}
	}
</style>